package com.bjsxt.thread;

public class ThreadTest extends Thread{
    public ThreadTest(){
        System.out.println(this.getName());
    }


    @Override
    public void run() {
        //线程体
        System.out.println(this.getName()+"线程开始");
        for (int i=0;i<200;i++){
            System.out.println(this.getName()+" "+i);
        }
        System.out.println(this.getName()+"线程结束");
    }

    public static void main(String[] args) {
        System.out.println("主线程开始");

        ThreadTest t1 = new ThreadTest();
        t1.start();

        ThreadTest t2 = new ThreadTest();
        t2.start();

        ThreadTest t3 = new ThreadTest();
        t3.start();

        System.out.println("主线程结束");

    }
}
